<template>
  <section class="component operation-log-details">
    <div style="white-space: pre-line;">
      {{dataText}}
    </div>
  </section>
</template>

<script lang="ts">
import Vue from 'vue'
import Component from 'vue-class-component'
import { Dependencies } from '~/core/decorator'
import { Prop } from 'vue-property-decorator'
import { OperationLogService } from '~/service/service-manage/operation-log.service';

@Component({})
export default class OperationLogDetails extends Vue {
  @Dependencies(OperationLogService) operationLogService: OperationLogService

  @Prop()
  private detailsId: string

  private data: any = {}

  public refreshData() {
    this.operationLogService.findOperationLogsDetails(this.detailsId).subscribe(
      data => this.data = data || {},
      error => this.$message.error(error.msg)
    )
  }

  private get dataText() {
    return this.data.text ? this.data.text.replace(/<br\/>/g,'\n') : ''
  }
}
</script>


